home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Experimental BBS Explossion 3
/
Experimental BBS Explossion III.iso
/
c
/
cp1.zip
/
KEY2.C
< prev
next >
Wrap
Text File
|
1993-06-14
|
2KB
|
70 lines
===========================================================================
BBS: The Abacus * HST/DS * Potterville MI
Date: 06-12-93 (11:07) Number: 265
From: BILL LINDSAY Refer#: NONE
To: ALL Recvd: NO
Subj: Keyboard info 2/ Conf: (36) C Language
---------------------------------------------------------------------------
>>> Continued from previous message
___----------------------------8<------------------------------------
int wait_for_key()
{
intregs.h.ah = (is_enhanced) ? ('\x11') : ('\x01');
int86 (0x16, &intregs, &intregs); /* check if key available */
return ((intregs.x.flags & 0x0040));
} /* Returns 0 if keycode available */
int board_type ()
{
int i;
intregs.h.ah = '\x05';
intregs.x.cx = 0xffff;
int86 (0x16, &intregs, &intregs); /* Put xffff in buffer */
for (i = 0; i < 16; i++) {
if (!(wait_for_key()))
{ /* Look for xffff in buffer */
intregs.h.ah = '\x10';
int86 (0x16, &intregs, &intregs);
if (intregs.x.ax == 0xffff)
break;
}
}
return (i == 16) ? (0) : (1); /* was xffff returned? */
} /* returns 1 for enhanced keyboard. */
void get_the_key (char *keys, unsigned char *togl)
{
while ((wait_for_key()))
{;}
intregs.h.al = '\x0';
intregs.h.ah = (is_enhanced) ? ('\x12') : ('\x02');
int86 (0x16, &intregs, &intregs); /* Get shift status */
*togl = intregs.h.al;
*(togl + 1) = intregs.h.ah;
intregs.h.ah = (is_enhanced) ? ('\x10') : ('\x00');
int86 (0x16, &intregs, &intregs); /* Get Character */
*keys = intregs.h.ah;
*(keys + 1) = intregs.h.al;
}
___------------------------ 8< --------------------------------------
-MESSAGE ENDS-
* SLMR 2.1a *
--- Maximus 2.01wb
* Origin: LIFELINE BBS - Edmonton, Ab, Canada! V32b (403)481-4977 (1:342/51)
SEEN-BY: 1/211 11/2 4 13/13 101/1 108/89 109/25 110/69 114/5 123/19 124/1
SEEN-BY: 153/752 154/40 77 157/110 159/100 125 430 575 950 203/23 209/209
SEEN-BY: 261/1023 280/1 390/1 396/1 5 15 2270/1 2430/1 2440/5 3603/20